package org.lex.notepad.ui.preferences;

import java.awt.Frame;
import java.io.IOException;


import org.lex.notepad.Notepad;
import org.lex.swing.prefs.PreferencesDialog;
import org.lex.swing.prefs.TitleDecorator;

public class NotepadPreferencesDialog extends PreferencesDialog {
	public NotepadPreferencesDialog(Frame owner) {
		super(owner);
		initialize();
	}

	private void initialize() {
		this.loadCategories(TitleDecorator.decorate(new AppearanceCategory(), new EditorCategory(), new TestCategory()));
	}

	/*
	 * save configurations to file
	 */
	public void saveConfiguration() {
		super.saveConfiguration();
		try {
			Notepad.getApplication().getContext().getResourceManager().save();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}
